home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_bas
/
pbc32.zip
/
PBC$BAS.ZIP
/
DATER2A.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-04-10
|
1KB
|
41 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone (C) Copyright 1996 Charon Software, All Rights Reserved |
' | |
' +----------------------------------------------------------------------+
DECLARE FUNCTION AscM% (St$, BYVAL Posn%)
SUB DateR2A (MonthNr%, DayNr%, YearNr%, RelDate&)
TDate& = RelDate&
YearNr% = 1899
DO WHILE TDate& >= 365&
IF YearNr% MOD 4 = 0 AND YearNr% MOD 100 > 0 OR YearNr% MOD 400 = 0 THEN
TDate& = TDate& - 366&
ELSE
TDate& = TDate& - 365&
END IF
YearNr% = YearNr% + 1
LOOP
IF TDate& < 0& THEN
MonthNr% = 12
DayNr% = 31
YearNr% = YearNr% - 1
ELSE
TDate& = TDate& + 1&
MonthNr% = 1
IF YearNr% MOD 4 = 0 AND YearNr% MOD 100 > 0 OR YearNr% MOD 400 = 0 THEN
MonthDay$ = "313232332323"
ELSE
MonthDay$ = "303232332323"
END IF
tmp% = AscM%(MonthDay$, MonthNr%) - 20
DO WHILE TDate& > CLNG(tmp%)
TDate& = TDate& - CLNG(tmp%)
MonthNr% = MonthNr% + 1
tmp% = AscM%(MonthDay$, MonthNr%) - 20
LOOP
DayNr% = CINT(TDate&)
END IF
END SUB